/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package mp.weixin.WXpublic;

/**
 *
 * @author 王仲秋
 */
public abstract class BaseSendKefuMessage {

    public BaseSendKefuMessage() {
    }

    public BaseSendKefuMessage(String openId) {
        this.toUser = openId;
    }
    private String toUser;
    private String kfAccount;

    public abstract BaseSendKefuMessage.SendTypeEnum getMsgType();

    public String getToUser() {
        return toUser;
    }

    public void setToUser(String toUser) {
        this.toUser = toUser;
    }

    public String getKfAccount() {
        return kfAccount;
    }

    public void setKfAccount(String kfAccount) {
        this.kfAccount = kfAccount;
    }
    

    public enum SendTypeEnum {

        /**
         * 文本消息
         */
        TEXT("文本", "text"),
        /**
         * 图片消息
         */
        IMAGE("图片", "image"),
        /**
         * 语音消息
         */
        VOICE("语音", "voice"),
        /**
         * 视频消息
         */
        VIDEO("视频", "video"),
        /**
         * 小视频消息
         */
        MUSIC("音乐", "music"),
        /**
         * 图文消息
         */
        NEWS("图文", "news"),
        /**
         * 点击后跳转的图文消息
         */
        MP_NEWS("点击跳转图文", "mpnews"),
        WXCARD("卡券", "wxcard");
        private final String desc;
        private final String type;

        SendTypeEnum(String desc, String type) {
            this.desc = desc;
            this.type = type;
        }

        public String getDesc() {
            return this.desc;
        }

        public String getType() {
            return type;
        }

        /**
         * 保证这个方法的正常使用必须保证 定义枚举对象的时候 枚举对象的名称是全大写 且 type属性转换成大写的时候 与枚举的对象名称一致
         *
         * @param type
         * @return
         */
        public static SendTypeEnum getEnumByType(String type) {
            return SendTypeEnum.valueOf(type.toUpperCase());
        }
    }

    public abstract String toWeiXinKefuMessageJsonString();
}
